import allure

from page_element.roncoo_power_manage import query_role
from page_object.roncoo_login import RoncooLogin
from page_element.el_A3mall import *
import logging
from utils.timer import sleep


class Select_Role(RoncooLogin):
    """查询权限"""

    def page_select_role_login(self,info1):
        # 前置条件：已登录
        self.roncoo_login()
        with allure.step(f"点击权限管理"):
            self.click(query_role.power_manage)
            sleep(2)
        with allure.step(f"点击角色管理"):
            self.click(query_role.role_manage)
            sleep(2)
        # with allure.step(f"点击输入框"):
        #     self.click(query_role.input_click)
        #     sleep(2)
        with allure.step(f"输入角色名称"):
            self.send_keys(query_role.role_name,info1)
            sleep(30)
        with allure.step(f"点击查询"):
            self.click(query_role.select_btn)
            sleep(2)
        with allure.step(f"断言权限名称"):
            dy = self.text(query_role.dy)
            assert '李凯鹏' == dy


